<?php
/*      SystemComponent         */
defined('__VN_BASE') or die ("Restricted Access");

class VNCore {

	protected function getSettings(string $val = NULL) {
		try{
			$settings = array(
				'dbhost' => 'localhost',
				'dbusername' => 'vnet',
				'dbpassword' => 'vnet',
				'dbname' => 'vnet',
				'VNSite' => 'http://localhost',
				'VNLocation' => '/web/sites/vnet-platform/',
				'VNName' => 'vNet Platform',
				'VNTime' => 'Y-n-d H:i:s',
				'VNDebug' => 'none'
			);
			
			//if settings could not be created
			if(!$settings){

				//throw an exception
				throw new VNException('Could Not Initiate VN Core',100,__CLASS__);
	
			}

			/* If ONLY a specific value is asked, return it. But not DB settings. */
			if(!empty($val)){

				if($val !== "dbhost" && $val !== "dbusername" && $val !== "dbpassword"){

					$settings = $settings[$val];

				}

			}


			return $settings;

		}catch(VNException $e){

			print $e;
			die();

		}
			
	}

};
?>
